<template><div><h2 id="手动切换" tabindex="-1"><a class="header-anchor" href="#手动切换" aria-hidden="true">#</a> 手动切换</h2>
<div class="language-bash ext-sh line-numbers-mode"><pre v-pre class="language-bash"><code><span class="token comment"># 查看当前环境下包镜像源</span>
<span class="token function">npm</span> config get registry
<span class="token comment"># 将下载的镜像切换为淘宝镜像源</span>
<span class="token function">npm</span> config <span class="token builtin class-name">set</span> <span class="token assign-left variable">registry</span><span class="token operator">=</span>https://registry.npm.taobao.org/
<span class="token comment"># 检查镜像源是否下载成功</span>
<span class="token function">npm</span> config get registry
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div><h2 id="nrm切换" tabindex="-1"><a class="header-anchor" href="#nrm切换" aria-hidden="true">#</a> nrm切换</h2>
<div class="language-bash ext-sh line-numbers-mode"><pre v-pre class="language-bash"><code><span class="token function">npm</span> i nrm -g
<span class="token comment"># 查看所有的镜像源</span>
nrm <span class="token function">ls</span>
<span class="token comment"># 切换淘宝镜像源</span>
nrm use taobao
</code></pre><div class="line-numbers" aria-hidden="true"><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div><div class="line-number"></div></div></div></div></template>
